﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Castle.Core.Interceptor;
using Castle.Core.Logging;

namespace Structura.Silverlight.Infrastructure.Logging
{
    public class LoggerInterceptor : IInterceptor
    {
        public LoggerInterceptor(ILogger logger)
        {
            Logger = logger;
        }

        private ILogger Logger;

        public void Intercept(IInvocation invocation)
        {
            Logger.InfoFormat("About to call method: {0}", invocation.Method.Name);
            invocation.Proceed();
            Logger.InfoFormat("Called method: {0}", invocation.Method.Name);
        }
    }
}
